<template>
  <div class="d-flex jcsb mb10 mt10">
    <div class="page-font-cus">
      {{
        `共${total}条数据，第${current}/${Math.ceil((total || 0) / (pageSize || 1))}页`
      }}
    </div>
    <div>
      <a-pagination
        v-model="current"
        show-size-changer
        show-quick-jumper
        v-bind="$props"
        @showSizeChange="onChangePage"
        @change="onChangePage"
      ></a-pagination>
    </div>
  </div>
</template>
<script>
export default {
  name: 'c-pagination',
  props: {
    value: {
      type: Number,
      default: 0
    },
    total: {
      type: Number,
      default: 0
    },
    pageSize: {
      type: Number,
      default: 25
    },
    pageSizeOptions: {
      type: Array,
      default: () => ['25', '50', '100']
    }
  },
  methods: {
    onChangePage(cur, size) {
      this.$emit('onChangePage', cur, size)
      this.$emit('input', cur)
    }
  },
  data() {
    return {
      current: 1
    }
  }
}
</script>
<style scoped>
.page-font-cus {
  font-family:
    PingFangSC-Regular,
    PingFang SC;
  font-weight: 400;
  color: #999999;
  font-size: 14px;
  font-weight: 400;
}
</style>
